<?php
	//load the file loader 
	require_once C_FW_fwPackage . 'utilities/Fileloader.php';
	//load the orm
	FileLoader::getInstance()->loadFile(C_FW_fwPackage . 'libraries/bootstrap.php');
	FileLoader::getInstance()->loadFile(C_FW_fwPackage . 'libraries/Doctrine.php');
	//load the form handler library FormMaker
	FileLoader::getInstance()->loadFile(C_FW_fwPackage . 'libraries/FormMaker.php');
	//load the utility functions for global usage
	FileLoader::getInstance()->loadFile(C_FW_fwPackage . 'utilities/util_functions.php');
	FileLoader::getInstance()->loadFile(C_FW_fwPackage . 'utilities/EncryptionHandler.php');
	FileLoader::getInstance()->loadFile(C_FW_fwPackage . 'utilities/SessionHandler.php');
	//initialize the session
	//this will initialize the session
	SessionHandler::getInstance()->start();
	
	//load the framework main appfiles
	FileLoader::getInstance()->loadLibrary('fw_mainAppFiles', C_FW_fwPackage . 'application');
	FileLoader::getInstance()->loadLibrary('fw_modules', C_FW_fwPackage . 'modules');
	//get an instance of the template class
	//customize loading for custom controller or any classes or anything
	
	//create the protected session array for writing
	//write to the session the formSubmitArray
	//SessionHandler::getInstance()->destroy();
	//load the custom main app controller 
	FileLoader::getInstance()->loadFile(C_FW_customPackage . 'controllers/MyApplicationController.php');
	//route the application.
	
	//no segregation between ajax and anything else here
	Claycode_Router::getInstance()->route();
	


	
	
